package cn.ixinjiu.libraryMangement.service.impl;

import cn.ixinjiu.libraryMangement.dao.IBorrowInfoDao;
import cn.ixinjiu.libraryMangement.dao.impl.BorrowInfoDaoImpl;
import cn.ixinjiu.libraryMangement.entity.BorrowInfo;
import cn.ixinjiu.libraryMangement.service.IBorrowInfoService;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by XinChen on 2023-05-12
 *
 * @TODO
 */
public class BorrowInfoServiceImpl implements IBorrowInfoService {

    private IBorrowInfoDao iBorrowInfoDao = new BorrowInfoDaoImpl();

    @Override
    public List<BorrowInfo> borrowsInfo() {
        return iBorrowInfoDao.borrowsInfo();
    }

    @Override
    public List<BorrowInfo> getBorrowsInfoByUserId(int userId) {
        return iBorrowInfoDao.getBorrowsInfoByUserId(userId);
    }

    @Override
    public int count() {
        return iBorrowInfoDao.count();
    }

    @Override
    public int borrowInfoDel(int id) {
        return iBorrowInfoDao.borrowInfoDel(id);
    }

    @Override
    public int borrowInfoDelByBookId(int bookId) {
        return iBorrowInfoDao.borrowInfoDelByBookId(bookId);
    }

    @Override
    public int borrowUpd(BorrowInfo borrowInfo) {
        return iBorrowInfoDao.borrowUpd(borrowInfo);
    }

    @Override
    public int borrowAdd(BorrowInfo borrowInfo) {
        return iBorrowInfoDao.borrowAdd(borrowInfo);
    }

    @Override
    public BorrowInfo getBorrowInfoById(int id) throws SQLException {
        return iBorrowInfoDao.getBorrowInfoById(id);
    }
}
